package Practice.Practice_02;

public class FactorialDemo {

    public static void main(String[] args) {
        int result = factorial((5));
        System.out.println(result);
    }

    public static int factorial(int n) {
        if (n == 1) {
            return 1;
        } else {
            return n * factorial(n - 1);
        }
    }
}
